package dao;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Chatmessage entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "chatmessage", catalog = "assistedlearning")
public class Chatmessage implements java.io.Serializable {

    // Fields

    private Integer messageid;
    private String source;
    private String destination;
    private String message;
    private String readflag;
    private Date sendtime;
    private String messagetype;
    private Integer replyid;

    // Constructors

    /** default constructor */
    public Chatmessage() {
    }

    /** full constructor */
    public Chatmessage(String source, String destination, String message,
	    String readflag) {
	this.source = source;
	this.destination = destination;
	this.message = message;
	this.readflag = readflag;
    }

    // Property accessors
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "messageid", unique = true, nullable = false)
    public Integer getMessageid() {
	return this.messageid;
    }

    public void setMessageid(Integer messageid) {
	this.messageid = messageid;
    }

    @Column(name = "source", nullable = false, length = 10)
    public String getSource() {
	return this.source;
    }

    public void setSource(String source) {
	this.source = source;
    }

    @Column(name = "destination", nullable = false, length = 10)
    public String getDestination() {
	return this.destination;
    }

    public void setDestination(String destination) {
	this.destination = destination;
    }

    @Column(name = "message", nullable = false, length = 256)
    public String getMessage() {
	return this.message;
    }

    public void setMessage(String message) {
	this.message = message;
    }

    @Column(name = "readflag", nullable = false, length = 1)
    public String getReadflag() {
	return this.readflag;
    }

    public void setReadflag(String readflag) {
	this.readflag = readflag;
    }
    
    @Column(name = "sendtime", length = 19)
    public Date getSendtime() {
        return sendtime;
    }

    public void setSendtime(Date sendtime) {
        this.sendtime = sendtime;
    }

    @Column(name = "messagetype", length = 1)
    public String getMessagetype() {
        return messagetype;
    }

    public void setMessagetype(String messagetype) {
        this.messagetype = messagetype;
    }

    @Column(name = "replyid")
    public Integer getReplyid() {
        return replyid;
    }

    public void setReplyid(Integer replyid) {
        this.replyid = replyid;
    }
    
}